package ACWing.mathematicalknowledge.约数;
//869. 试除法求约数

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

/**
 * @author :chenjie
 * @date :Created 2023/1/10 17:30
 */
public class TrialDivisionFindDivisor {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        while (n-->0){
            int x=sc.nextInt();
            division(x);
        }
    }
    public static void division(int n){
        List<Integer> list=new ArrayList<>();
        for (int i = 1; i <= n/i; i++) {//与质数有着一样的地方
            if(n%i==0){
                list.add(i);
                if(i!=n/i){
                    list.add(n/i);
                }
            }
        }
        list.sort(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1-o2;
            }
        });
        for (int i = 0; i < list.size(); i++) {
            System.out.print(list.get(i));
        }
        System.out.println();
    }
}
